#include <iostream>
using namespace std;

class String {
public:
  String(const char *s);
  String();
  String(const String &);
  ~String();
  int length() const { return len; }
  String &operator=(const String &);
  String &operator=(const char *);
  char &operator[](int i);
  const char &operator[](int i) const;

  // friend
  friend bool operator<(const String &st, const String &st2);
  friend bool operator>(const String &st, const String &st2);
  friend bool operator==(const String &st, const String &st2);
  friend ostream &operator<<(ostream &os, const String &st);
  friend istream &operator>>(istream &is, String &st);
  // statis
  static int HowMany();

private:
  char *str;
  int len;
  static int num_strings;
  static const int CINLIN = 80;
};
